viewport: don't render a background over the bin window
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 28 Dec 2015 20:21:27 +0000 (12:21 -0800)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 29 Dec 2015 21:50:19 +0000 (13:50 -0800)
GtkViewport currently tries to draw a background over the bin window.
The feature is a bit broken at the moment, as it does not take into
account padding that might have been set on the GtkViewport, but in
general it does not seem very useful, and goes somewhat against the CSS
box model where every widget/gadget is responsible to draw its own
background. For a fix, we could either have the viewport gain a "bin"
gadget, or we could stop drawing the background.

As it isn't clear that there are any users of this feature, stop drawing
the background; a client can achieve the same effect by drawing the
background on the widget inside the viewport itself.

gtk/gtkviewport.c

index 1fe575f6c1154fe7f8462870ac568c235ef5345e..7a67fb8de98ede5a98caf6605763b402315ff741 100644 (file)
@@ -321,17 +321,6 @@ draw_bin (cairo_t *cr,
          gpointer user_data)
 {
   GtkWidget *widget = GTK_WIDGET (user_data);
-  GtkViewport *viewport = GTK_VIEWPORT (widget);
-  GtkViewportPrivate *priv = viewport->priv;
-  GtkStyleContext *context;
-  int x, y;
-
-  context = gtk_widget_get_style_context (widget);
-
-  gdk_window_get_position (priv->bin_window, &x, &y);
-  gtk_render_background (context, cr, x, y,
-                        gdk_window_get_width (priv->bin_window),
-                        gdk_window_get_height (priv->bin_window));
   GTK_WIDGET_CLASS (gtk_viewport_parent_class)->draw (widget, cr);
 }